#pragma once

#include <base.h>

/* c内存屏障，防止编译器重排 */
#define cmb()		asm volatile(""	: : : "memory")

#define mb()		__atomic_thread_fence(__ATM_ACQREL)
#define rmb()		__atomic_thread_fence(__ATM_ACQUIRE)
#define wmb()		__atomic_thread_fence(__ATM_RELEASE)

#define mp_mb()		__atomic_thread_fence(__ATM_ACQREL)
#define mp_rmb()	__atomic_thread_fence(__ATM_ACQUIRE)
#define mp_wmb()	__atomic_thread_fence(__ATM_RELEASE)


